﻿using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Dryricenet
{
   
    public partial class Index : System.Web.UI.MasterPage
    {
        public string tx ="img/profile_small.jpg";
        protected void Page_Load(object sender, EventArgs e)
        {
           
            if (Session["Name"] == null)
            {
                txtHT.Visible = false;
            }
            else
            {
                string name = Session["Name"].ToString();
                DataTable dt = userBLL.selectNameBll(name);
                DataRow dr = dt.Rows[0];//第一条数据
                if (dr["Image"].ToString() != "")
                {
                    tx = dr["Image"].ToString();
                }
                int number =Convert.ToInt32(userBLL.userGLBLL(name));
               
                if (number==2)
                {
                    txtHT.Visible = true;
                }
                else if (number == 1)
                {
                    txtHT.Visible = false;
                }
            }
        }
       
        //后台
        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("houTai/Backstage.aspx");
        }
        //搜索
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string foodname = foodName.Text.Trim();
            Response.Redirect("home_Search.aspx?name=" + foodname);
        }
    }
}